<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box{
            width:100px;
            height:100px;
            background-color: darkblue;
            /*2.设置动画*/
            animation-name: move;
            animation-duration: 5s;
            /*设置执行动画的次数*/
            animation-iteration-count: infinite;

            /*逆向执行动画*/
            animation-direction: reverse;
        }
        .box:hover{
            /*鼠标放到盒子上让盒子暂停*/
            animation-play-state:paused;
        }
        /*1.设置关键帧*/
        @keyframes move {
            0%{
                transform: translate(0,0);
            }
            25%{
                transform:translate(600px,0);
            }
            50%{
                transform: translate(600px,600px);
            }
            75%{
                transform: translate(0px,600px);
            }
            100%{
                transform: translate(0,0);
            }
        }
    </style>
</head>
<body>
<div class="box"></div>

</body>
</html>